import request from '@/utils/request'
import service from '@/api/config/const'
import { getDeviceId } from '@/utils/auth'
import { paramToString } from '@/utils/param'

export function loginByUsername(username, password, imageCode) {
  const deviceId = getDeviceId()
  const data = {
    username,
    password,
    imageCode,
    deviceId
  }
  return request.post(service.oauth + '/user/login', paramToString(data))
}

